module.exports = {
  lintOnSave: false,
  chainWebpack: (config) => {
    config.plugin('html').tap((args) => {
      args[0].title = '货运源头企业信息采集系统'
      return args
    })
  },
  devServer: {
    host: '0.0.0.0',
    port: 9530,
    proxy: {
      '/api': {
        target: 'http://192.168.1.106:8003',
        pathRewrite: {
          '^/api': ''
        },
        changeOrigin: true
      },
      '/xianyu': {
        target: 'http://m.xianyustudio.top:9091',
        pathRewrite: {
          '^/xianyu': ''
        },
        changeOrigin: true
      },
      '/aa': {
        target: 'http://106.127.186.34:9530/',
        pathRewrite: {
          '^/aa': ''
        },
        changeOrigin: true
      }
    }
  },
  configureWebpack: {
    devtool: 'source-map'
  },
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          require('postcss-px-to-viewport')({
            viewportWidth: 1920, // 设计稿宽度
            unitPrecision: 5, // px转换后的小数保留位数，有时候不能整除
            minPixelValue: 1, // 小于或等于`1px`时不转换为视窗单位
            include: [/bashboard/, /dataSearchDetail/, /cs-steps/, /cs-warningLabel/]
          })
        ]
      }
    }
  }
}
